package net.xdclass.online_xdclass.mapper;

import net.xdclass.online_xdclass.model.entity.VideoOrder;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author kingtao
 * @date 2022/3/6
 */
public interface VideoOrderMapper {
    //  查询用户是否购买过此商品
    VideoOrder findByUserIdAndVideoIdAndState(@Param("user_id") int userId, @Param("video_id") int videoId, @Param("state") int state);

    //  下单
    int saveOrder(VideoOrder videoOrder);

    //  视频列表
    List<VideoOrder> listOrderById(@Param("user_id") Integer userId);
}
